<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateVerifyTable extends Migration
{
    public function up()
    {
        //短信验证
        Schema::create('sms_verify', function (Blueprint $table) {
            $table->increments('id');
            $table->string('phone', 11)->unique()-> comment('手机号');
            $table->string('verify', 6)->comment('验证码');
            $table->timestamps();
        });
        //邮箱验证 密码重置
        Schema::create('email_verify', function (Blueprint $table) {
            $table->increments('id');
            $table->string('email', 50)->unique()-> comment('邮箱');
            $table->string('token', 50)->comment('令牌');
            $table->timestamp('end_time')->comment('有效期');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('sms_verify');
        Schema::dropIfExists('email_verify');
    }
}
